package com.dts;

import com.dts.entity.Card;
import com.dts.service.EmpService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.util.List;

public class Test {
    public static void main(String[] args)  {
        //加载spring配置
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        Card card = (Card) context.getBean("card");

//        context= new AnnotationConfigApplicationContext()
        EmpService empService = (EmpService) context.getBean("empService");
        List<String> allEmp = empService.getAllEmp();
        allEmp.forEach(emp -> {
            System.out.println(emp);
        });
    }
}